<template>
  <div class="read container">
    <div v-for="(item, index) in books" :key="index">
      <div>
        <a :href='item' target="_blank">{{item}}</a>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'hello',
    data () {
      return {
        msg: 'Welcome to Your Vue.js App',
        content: '',
        books: []
      }
    },
    watch: {
      'content': function (val, oldVal) {
        this.search(val)
      }
    },
    created () {
      this.books = this.$route.params.books.data
//      console.log(this.$route.params)
    },
    methods: {
      search: function (val) {
        console.log(val)
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
